package com.yami.shop.api.exception;


import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

@ControllerAdvice
@ResponseBody
@Slf4j
public class GlobalExceptionAdvice<T> {

    @Autowired(required = false)
    private HttpServletRequest httpServletRequest;


//    @ExceptionHandler(Exception.class)
//    public ResponseEntity handleCommonException(Exception e){
//        String threadName = Thread.currentThread().getName();
//        log.error("通用异常",e);
//
//        return ResponseEntity.ok().body(e);
//    }

}
